
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Abp.Domain.Entities.Auditing
{
    public class AjaxResult
    {
        public AjaxResult()
        {
            this.IsSuccess = true;
            this.IsException = false;
            this.Message = "操作成功!";
            this.Data = null;
        }
        private bool _IsSuccess = true;
        public bool IsSuccess
        {
            get { return this._IsSuccess; }
            set
            {
                if (value)
                    this.Message = "操作成功!";
                else
                    this.Message = "操作失败!";
                this._IsSuccess = value;
            }
        }       
        public string Message { get; set; }
        public string AbsoluteUri { get; set; }
        public bool IsException { get; set; }
        public object PrimaryId { get; set; }
        public object Data { get; set; }

        public void SetException(Exception ex)
        {
            this.IsSuccess = false;
            this.IsException = true;
            this.Message = ex.Message;
        }
       
    }
}
